const fs = require('fs');
module.exports =(res,urlObj,bodyObj,sql) => {
  
  const re=fs.writeFileSync("./serve/www/lolimg/"+bodyObj.name+"-s.png",new Buffer(bodyObj.small.replace(/^data.+base64,/,""), 'base64'));
  const re2=fs.writeFileSync("./serve/www/lolimg/"+bodyObj.name+"-l.png",new Buffer(bodyObj.large.replace(/^data.+base64,/,""), 'base64'));
  console.log(re,re2)
  res.end(
  JSON.stringify({
    code: 0,
    msg: "请求成功",
//    data: results
  }));
//  sql.query(query,  (error, results, fields) =>{
//    if (error) res.end(JSON.stringify({code:0,msg:"请求失败"}));
//    else res.end(
//      JSON.stringify({
//        code: 0,
//        msg: "请求成功",
//        data: results
//      })
//    );
//  });
}
